<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>emaclite: xemaclite_example.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">emaclite
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xemaclite__example_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xemaclite_example.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>Defines common data types, prototypes, and includes the proper headers for use with the EmacLite example code residing in this directory. </p>
<p>This file along with <a class="el" href="xemaclite__example__util_8c.html" title="This file implements the utility functions for the EmacLite example code. ">xemaclite_example_util.c</a> are utilized with the specific example code in the other source code files provided.</p>
<p>These examples are designed to be compiled and utilized within the EDK standalone BSP development environment. The readme file contains more information on build requirements needed by these examples.</p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
<hr/>

2.00a ktn  04/13/09 First release
3.03a bss  09/01/12 Moved the declarations of RecvFrameLength
              TransmitComplete, EmacLiteInstance,
              TxFrame[XEL_MAX_FRAME_SIZE], RxFrame[XEL_MAX_FRAME_SIZE];
                      to <a class="el" href="xemaclite__example__util_8c.html" title="This file implements the utility functions for the EmacLite example code. ">xemaclite_example_util.c</a> for fixing C++ compilation
              errors
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ae9b61e9b176db206875b77fb002fff05"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemaclite__example_8h.html#ae9b61e9b176db206875b77fb002fff05">EmacLitePhyDelay</a> (unsigned int Seconds)</td></tr>
<tr class="memdesc:ae9b61e9b176db206875b77fb002fff05"><td class="mdescLeft">&#160;</td><td class="mdescRight">For PPC we use a usleep call, for Microblaze we use an assembly loop that is roughly the same regardless of optimization level, although caches and memory access time can make the delay vary.  <a href="#ae9b61e9b176db206875b77fb002fff05">More...</a><br /></td></tr>
<tr class="separator:ae9b61e9b176db206875b77fb002fff05"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2799884dbcd4e24e3f7fda067d457567"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemaclite__example_8h.html#a2799884dbcd4e24e3f7fda067d457567">EmacLitePhyDetect</a> (<a class="el" href="struct_x_emac_lite.html">XEmacLite</a> *InstancePtr)</td></tr>
<tr class="memdesc:a2799884dbcd4e24e3f7fda067d457567"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function detects the PHY address by looking for successful MII status register contents (PHY register 1).  <a href="#a2799884dbcd4e24e3f7fda067d457567">More...</a><br /></td></tr>
<tr class="separator:a2799884dbcd4e24e3f7fda067d457567"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae929ecf7843aa6c7ca8a09b5cf6746c7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemaclite__example_8h.html#ae929ecf7843aa6c7ca8a09b5cf6746c7">EmacLiteEnablePhyLoopBack</a> (<a class="el" href="struct_x_emac_lite.html">XEmacLite</a> *InstancePtr, u32 PhyAddress)</td></tr>
<tr class="memdesc:ae929ecf7843aa6c7ca8a09b5cf6746c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function enables the MAC loopback on the PHY.  <a href="#ae929ecf7843aa6c7ca8a09b5cf6746c7">More...</a><br /></td></tr>
<tr class="separator:ae929ecf7843aa6c7ca8a09b5cf6746c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f1980c002b40ba720934300f6960124"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemaclite__example_8h.html#a1f1980c002b40ba720934300f6960124">EmacLiteDisablePhyLoopBack</a> (<a class="el" href="struct_x_emac_lite.html">XEmacLite</a> *InstancePtr, u32 PhyAddress)</td></tr>
<tr class="memdesc:a1f1980c002b40ba720934300f6960124"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function disables the MAC loopback on the PHY.  <a href="#a1f1980c002b40ba720934300f6960124">More...</a><br /></td></tr>
<tr class="separator:a1f1980c002b40ba720934300f6960124"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a1f1980c002b40ba720934300f6960124"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1f1980c002b40ba720934300f6960124">&#9670;&nbsp;</a></span>EmacLiteDisablePhyLoopBack()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int EmacLiteDisablePhyLoopBack </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_emac_lite.html">XEmacLite</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>PhyAddress</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function disables the MAC loopback on the PHY. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is the pointer to the instance of EmacLite driver. </td></tr>
    <tr><td class="paramname">PhyAddress</td><td>is the address of the Phy device.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the loop back was disabled.</li>
<li>XST_FAILURE if the loop back was not disabled.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="group__emaclite__v4__1.html#ga444ab091bdc373bf2e1a266d5febecd0">XEmacLite_PhyRead()</a>.</p>

</div>
</div>
<a id="ae929ecf7843aa6c7ca8a09b5cf6746c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae929ecf7843aa6c7ca8a09b5cf6746c7">&#9670;&nbsp;</a></span>EmacLiteEnablePhyLoopBack()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int EmacLiteEnablePhyLoopBack </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_emac_lite.html">XEmacLite</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>PhyAddress</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function enables the MAC loopback on the PHY. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is the pointer to the instance of EmacLite driver. </td></tr>
    <tr><td class="paramname">PhyAddress</td><td>is the address of the Phy device.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the loop back is enabled.</li>
<li>XST_FAILURE if the loop back was not enabled.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="ae9b61e9b176db206875b77fb002fff05"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae9b61e9b176db206875b77fb002fff05">&#9670;&nbsp;</a></span>EmacLitePhyDelay()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void EmacLitePhyDelay </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>Seconds</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>For PPC we use a usleep call, for Microblaze we use an assembly loop that is roughly the same regardless of optimization level, although caches and memory access time can make the delay vary. </p>
<p>Just keep in mind that after resetting or updating the PHY modes, the PHY typically needs time to recover.</p>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

</div>
</div>
<a id="a2799884dbcd4e24e3f7fda067d457567"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2799884dbcd4e24e3f7fda067d457567">&#9670;&nbsp;</a></span>EmacLitePhyDetect()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 EmacLitePhyDetect </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_emac_lite.html">XEmacLite</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function detects the PHY address by looking for successful MII status register contents (PHY register 1). </p>
<p>It looks for a PHY that supports auto-negotiation and 10Mbps full-duplex and half-duplex. So, this code won't work for PHYs that don't support those features, but it's a bit more general purpose than matching a specific PHY manufacturer ID.</p>
<p>Note also that on some (older) Xilinx ML4xx boards, PHY address 0 does not properly respond to this query. But, since the default is 0 and assuming no other address responds, then it seems to work OK.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is the pointer to the instance of EmacLite driver.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The address of the PHY device detected (returns 0 if not detected).</dd></dl>
<dl class="section note"><dt>Note</dt><dd>The bit mask (0x1808) of the MII status register (PHY Register 1) used in this function are: 0x1000: 10Mbps full duplex support. 0x0800: 10Mbps half duplex support. 0x0008: Auto-negotiation support. </dd></dl>

<p class="reference">References <a class="el" href="group__emaclite__v4__1.html#ga444ab091bdc373bf2e1a266d5febecd0">XEmacLite_PhyRead()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
